import request from './request'

// 获取文件列表
export const getFileList = (params) => {
  return request({
    url: '/files',
    method: 'GET',
    params
  })
}

// 上传文件
export const uploadFile = (data) => {
  return request({
    url: '/files',
    method: 'POST',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 删除文件
export const deleteFile = (id) => {
  return request({
    url: `/files/${id}`,
    method: 'DELETE'
  })
}

// 批量删除文件
export const deleteFiles = (ids) => {
  return request({
    url: '/files',
    method: 'DELETE',
    data: { ids }
  })
}
